﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SetGroups.aspx.cs" Inherits="OA.Exam.SetGroups" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>设置分组</title>
    <link href="../Themes/Default/Style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript">
        function IsCheckNode() {
            var groupId = document.getElementById("HiddenGroupId").value;
            if (groupId == "") {
                return false;
            }
            else {
                return true;
            }
        }

        function GoSelect() {
            //var myNodes = document.getElementsByTagName('a');
            //for (var i = 0; i < myNodes.length; i++) {
            if (obj.id.indexOf("TreeView1t0") != -1) {
                return false;
            }
            else {
                return true;
            }
        }

        function checkAllUp() {
            var Myform = document.getElementsByTagName("input");

            if (document.all.chballup.checked) {
                for (var i = 0; i < Myform.length; i++) {
                    if (Myform[i].id.indexOf("GridViewQuestionsUp") != -1) {
                        Myform[i].checked = true;
                    }
                }
            }
            else {

                for (var i = 0; i < Myform.length; i++) {
                    if (Myform[i].id.indexOf("GridViewQuestionsUp") != -1) {
                        Myform[i].checked = false;
                    }
                }
            }
        }

        function checkAllDown() {
            var Myform = document.getElementsByTagName("input");

            if (document.all.chballdown.checked) {
                for (var i = 0; i < Myform.length; i++) {
                    if (Myform[i].id.indexOf("GridViewQuestionsDown") != -1) {
                        Myform[i].checked = true;
                    }
                }
            }
            else {

                for (var i = 0; i < Myform.length; i++) {
                    if (Myform[i].id.indexOf("GridViewQuestionsDown") != -1) {
                        Myform[i].checked = false;
                    }
                }
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table width="98%">
            <tr>
                <td colspan="3" class="TitleZone">
                    批量设置题目分组
                    <input id="HiddenGroupId" type="hidden" runat="server" value="" />
                </td>
            </tr>
            <tr>
                <td colspan="3" align="center">
                    <asp:Label ID="LabPrompt" runat="server" Text="" ForeColor="Red"></asp:Label>
                </td>
            </tr>
            <tr>
                <td style="width: 20%">
                    <asp:Button ID="BtnTrigger" runat="server" Text="触发Ajax控件" Width="0px" />
                </td>
                <td>
                </td>
                <td style="width: 70%">
                    
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    请选择分组：
                </td>
                <td rowspan="2" style="background-color: #e2c0a4; text-align: center;">
                    已设分组
                </td>
                <td>
                    &nbsp;&nbsp;题型：
                    <asp:DropDownList ID="DdlTypeUp" runat="server" CssClass="" AppendDataBoundItems="true"
                        DataTextField="TypeName" DataValueField="TypeId">
                        <asp:ListItem Value="-1">-请选择-</asp:ListItem>
                    </asp:DropDownList>
                    &nbsp;&nbsp;题目：
                    <asp:TextBox ID="TxtSubjectUp" runat="server" CssClass="inputText"></asp:TextBox>
                    &nbsp;&nbsp;<asp:Button ID="BtnSearcnUp" runat="server" Text="查询" 
                        CssClass="closebtn" onclick="BtnSearcnUp_Click" OnClientClick="return IsCheckNode()" />
                </td>
            </tr>
            <tr>
                <td rowspan="4" valign="top">
                    <asp:TreeView ID="TreeView1" runat="server" 
                        onselectednodechanged="TreeView1_SelectedNodeChanged">
                        <SelectedNodeStyle Font-Bold="True" ForeColor="Red" />
                    </asp:TreeView>
                </td>
                <td>
                    <asp:GridView ID="GridViewQuestionsUp" runat="server" AutoGenerateColumns="false"
                        CssClass="GridViewStyle" Width="98%" AllowPaging="true" EmptyDataText="暂无题目"
                        DataKeyNames="QuestionId">
                        <Columns>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <input id="chballup" type="checkbox" onclick="checkAllUp()" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="ChbCheck" runat="server" />
                                </ItemTemplate>
                                <HeaderStyle Width="4%" HorizontalAlign="Left" />
                                <ItemStyle Width="4%" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="TypeName" HeaderText="题型" ItemStyle-Width="10%">
                                <ItemStyle Width="10%"></ItemStyle>
                            </asp:BoundField>
                            <asp:BoundField DataField="Subject" HeaderText="题目" ItemStyle-Width="50%">
                                <ItemStyle Width="50%"></ItemStyle>
                            </asp:BoundField>
                        </Columns>
                        <FooterStyle CssClass="GridViewFooterStyle" />
                        <RowStyle CssClass="GridViewRowStyle" />
                        <SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
                        <PagerStyle CssClass="GridViewPagerStyle" />
                        <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                        <HeaderStyle CssClass="GridViewHeaderStyle" />
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td style="background-color: #e2c0a4; text-align: center;">
                    移动
                </td>
                <td style="text-align: center">
                    <asp:Button ID="BtnSet" runat="server" Text="↑" CssClass="closebtn" Width="30px"
                        Height="60px" onclick="BtnSet_Click" />&nbsp;
                    <asp:Button ID="BtnRemove" runat="server" Text="↓" CssClass="closebtn" Width="30px"
                        Height="60px" onclick="BtnRemove_Click" />
                </td>
            </tr>
            <tr>
                <td rowspan="2" style="background-color: #e2c0a4; text-align: center;">
                    可设分组
                </td>
                <td>
                    &nbsp;&nbsp;题型：
                    <asp:DropDownList ID="DdlTypeDown" runat="server" CssClass="" AppendDataBoundItems="true"
                        DataTextField="TypeName" DataValueField="TypeId">
                        <asp:ListItem Value="-1">-请选择-</asp:ListItem>
                    </asp:DropDownList>
                    &nbsp;&nbsp;题目：
                    <asp:TextBox ID="TxtSubjectDown" runat="server" CssClass="inputText"></asp:TextBox>
                    &nbsp;&nbsp;<asp:Button ID="BtnSearchDown" runat="server" Text="查询" 
                        CssClass="closebtn" onclick="BtnSearchDown_Click" OnClientClick="return IsCheckNode()" />
                </td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="GridViewQuestionsDown" runat="server" AutoGenerateColumns="false"
                        CssClass="GridViewStyle" Width="98%" AllowPaging="true" EmptyDataText="暂无题目"
                        DataKeyNames="QuestionId">
                        <Columns>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <input id="chballdown" type="checkbox" onclick="checkAllDown()" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="ChbCheck" runat="server" />
                                </ItemTemplate>
                                <HeaderStyle Width="4%" HorizontalAlign="Left" />
                                <ItemStyle Width="4%" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="TypeName" HeaderText="题型" ItemStyle-Width="10%">
                                <ItemStyle Width="10%"></ItemStyle>
                            </asp:BoundField>
                            <asp:BoundField DataField="Subject" HeaderText="题目" ItemStyle-Width="50%">
                                <ItemStyle Width="50%"></ItemStyle>
                            </asp:BoundField>
                        </Columns>
                        <FooterStyle CssClass="GridViewFooterStyle" />
                        <RowStyle CssClass="GridViewRowStyle" />
                        <SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
                        <PagerStyle CssClass="GridViewPagerStyle" />
                        <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                        <HeaderStyle CssClass="GridViewHeaderStyle" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
